﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MiserBlogData.Entities;

namespace MiserBlogMVC.Models
{
    public class UserModelBinder : BinderBase
    {

        public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            UserVIP user = (UserVIP)(bindingContext.Model ?? new UserVIP());
            user.Name = GetValue<string>(bindingContext, "Name");
            user.Pwd = GetValue<string>(bindingContext, "Pwd");

            return user;
        }
    }
}